home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / uim / zaurus.scm < prev   
Encoding:
Text File  |  2010-11-07  |  6.9 KB  |  213 lines

  1. ;; zaurus.scm: platform-specific support for Sharp Zaurus PDA
  2. ;;;
  3. ;;; Copyright (c) 2003-2009 uim Project http://code.google.com/p/uim/
  4. ;;;
  5. ;;; All rights reserved.
  6. ;;;
  7. ;;; Redistribution and use in source and binary forms, with or without
  8. ;;; modification, are permitted provided that the following conditions
  9. ;;; are met:
  10. ;;; 1. Redistributions of source code must retain the above copyright
  11. ;;;    notice, this list of conditions and the following disclaimer.
  12. ;;; 2. Redistributions in binary form must reproduce the above copyright
  13. ;;;    notice, this list of conditions and the following disclaimer in the
  14. ;;;    documentation and/or other materials provided with the distribution.
  15. ;;; 3. Neither the name of authors nor the names of its contributors
  16. ;;;    may be used to endorse or promote products derived from this software
  17. ;;;    without specific prior written permission.
  18. ;;;
  19. ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
  20. ;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. ;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. ;;; ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
  23. ;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  24. ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  25. ;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  26. ;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  27. ;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  28. ;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  29. ;;; SUCH DAMAGE.
  30. ;;;;
  31.  
  32. ;;
  33. ;; This file is intended to use with IMKit-uim on Qtopia platform
  34. ;; See following documents for Zaurus specific key definitions
  35. ;;
  36. ;; SL-A300
  37. ;; http://developer.ezaurus.com/sl_j/doc/software/keycode_qt_a300_20021213.pdf
  38. ;;
  39. ;; SL-B500 and SL-C700
  40. ;; http://developer.ezaurus.com/sl_j/doc/software/keycode_b500c700.pdf
  41.  
  42. (require "generic-key.scm")
  43.  
  44. (define-key zaurus-calendar-key? "F9")
  45.  
  46. (define-key zaurus-addressbook-key? "F10")
  47.  
  48. (define-key zaurus-menu-key? "F11")
  49.  
  50. ;; application key to show "Home" tab of the launcher, not ordinary
  51. ;; "Home" key in desktop environment
  52. (define-key zaurus-home-key? "F12")
  53.  
  54. (define-key zaurus-mail-key? "F13")
  55.  
  56. ;; "Mail" being pressed long
  57. (define-key zaurus-mail-pressed-long-key? "F14")
  58.  
  59. (define-key zaurus-zenkaku-hankaku-key? "F21")
  60.  
  61. ;; "Fn" modifier key
  62. ;; modified keys are translated to another unmodified key by Qt/Embedded
  63. (define-key zaurus-fn-key? "F22")
  64.  
  65. ;; Fn + Space ("OnKun")
  66. (define-key zaurus-onkun-key? "F23")
  67.  
  68. ;; Fn + "Zenkaku/Hankaku" ("Kanji")
  69. (define-key zaurus-kanji-key? "F25")
  70.  
  71. ;; Katakana/Hiragana toggle
  72. (define-key zaurus-katakana-hiragana-key? "F26")
  73.  
  74. ;; "SELECT" on SL-5500 (center of round cursor keys)
  75. (define-key zaurus-select-key? "F30")
  76. (define-key zaurus-shift-select-key? "<Shift>F30")
  77.  
  78. ;; Fn + "Katakana/Hiragana" ("Kigou")
  79. (define-key zaurus-kigou-key? "F31")
  80.  
  81. ;; "Sync start" button on cradle
  82. (define-key zaurus-sync-start-key? "F32")
  83.  
  84. (define-key zaurus-ok-key? "F33")
  85.  
  86. ;; Power switch (don't use this key)
  87. (define-key zaurus-power-key? "F34")
  88.  
  89. ;; "Calendar" being pressed long (as "Sync" on SL-C700)
  90. (define-key zaurus-sync-key? "F35")
  91.  
  92. ;;; following keysyms are locally assigned by IMKit-uim from raw integer
  93. ;; Fn + 1 ("Zoom out")
  94. (define-key zaurus-zoom-out-key? "Private1")
  95.  
  96. ;; Fn + 2 ("Zoom in")
  97. (define-key zaurus-zoom-in-key? "Private2")
  98.  
  99. ;; Fn + 3 ("Decrease contrast")
  100. (define-key zaurus-decrease-contrast-key? "Private3")
  101.  
  102. ;; Fn + 4 ("Increase contrast")
  103. (define-key zaurus-increase-contrast-key? "Private4")
  104.  
  105. ;; Fn + 5
  106. (define-key zaurus-fn-5-key? "Private5")
  107.  
  108. ;; Fn + 6 ("Hiragana")
  109. (define-key zaurus-hiragana-mode-key? "Private6")
  110.  
  111. ;; Fn + 7 ("Katakana")
  112. (define-key zaurus-katakana-mode-key? "Private7")
  113.  
  114. ;; Fn + 8 ("half-width Katakana")
  115. (define-key zaurus-half-katakana-mode-key? "Private8")
  116.  
  117. ;; Fn + 9 ("fullwidth Alphanumeric")
  118. (define-key zaurus-wide-latin-mode-key? "Private9")
  119.  
  120. ;; Fn + 0 ("Alphanumeric")
  121. (define-key zaurus-latin-mode-key? "Private10")
  122.  
  123. ;; Fn + Q
  124. (define-key zaurus-fn-q-key? "Private11")
  125.  
  126. ;; Fn + O
  127. (define-key zaurus-fn-o-key? "Private12")
  128.  
  129. ;; Fn + P
  130. (define-key zaurus-fn-p-key? "Private13")
  131.  
  132. ;; Fn + A
  133. (define-key zaurus-fn-a-key? "Private14")
  134.  
  135. ;; Fn + S
  136. (define-key zaurus-fn-s-key? "Private15")
  137.  
  138. ;; Fn + K
  139. (define-key zaurus-fn-k-key? "Private16")
  140.  
  141. ;; Fn + N
  142. (define-key zaurus-fn-n-key? "Private17")
  143.  
  144. ;; Fn + M
  145. (define-key zaurus-fn-m-key? "Private18")
  146.  
  147. ;;; SL-6000 specific keys
  148. ;; "Backlight"
  149. (define-key zaurus-backlight-key? "F35")
  150.  
  151. ;; "Backlight" being pressed long ("Rotate screen on the fly")
  152. (define-key zaurus-rotate-screen-key? "Private19")
  153.  
  154. ;; "Rec" being pressed long
  155. (define-key zaurus-rec-key? "Private20")
  156.  
  157. ;; user defined key (looks like "(  *  )")
  158. (define-key zaurus-user-defined-key? "Private21")
  159.  
  160.  
  161. ;; save original definitions
  162. (define zaurus-orig-modifier-key? modifier-key?)
  163. (define zaurus-orig-generic-begin-conv-key? generic-begin-conv-key?)
  164. (define zaurus-orig-generic-next-candidate-key? generic-next-candidate-key?)
  165. (define zaurus-orig-generic-commit-key? generic-commit-key?)
  166. (define zaurus-orig-generic-cancel-key? generic-cancel-key?)
  167.  
  168. (define-key zaurus-begin-conv-key?
  169.   '(zaurus-orig-generic-begin-conv-key? zaurus-select-key?))
  170. (define-key zaurus-next-candidate-key?
  171.   '(zaurus-orig-generic-next-candidate-key? zaurus-select-key?))
  172.  
  173. ;; "OK" key is not included to avoid accidential termination of application
  174. (define-key zaurus-commit-key? 'zaurus-orig-generic-commit-key?)
  175.  
  176. ;; "CANCEL" key is already bound as 'escape("CANCEL" key in Zaurus) in
  177. ;; generic-cancel-key?, so ignore it to avoid accidential termination
  178. ;; of application
  179. (define zaurus-cancel-key?
  180.   (lambda (key key-state)
  181.     (or
  182.      (and
  183.       (not (eq? key 'escape))
  184.       (zaurus-orig-generic-cancel-key? key key-state))
  185.      (zaurus-shift-select-key? key key-state))))
  186.  
  187. ;; additionally bind "OK" key for commit
  188. (define-key zaurus-barbarous-commit-key? '(zaurus-commit-key? zaurus-ok-key?))
  189.  
  190. ;; additionally bind "CANCEL" key for cancel operation
  191. (define-key zaurus-barbarous-cancel-key? '(zaurus-cancel-key? "escape"))
  192.  
  193. ;; placeholder for future use
  194. (define zaurus-translate-key
  195.   (lambda (key key-state)
  196.     (cond
  197.      ((zaurus-zenkaku-hankaku-key? key key-state)
  198.       ('zenkaku-hankaku key-state))
  199.      ((zaurus-katakana-hiragana-key? key key-state)
  200.       ('Mode_switch key-state)))))
  201.  
  202. ;; ignore Fn key as modifier key
  203. (define-key modifier-key? '(zaurus-orig-modifier-key? zaurus-fn-key?))
  204.  
  205. ;; replace the default keybindings to fit Zaurus hardware
  206. (define generic-begin-conv-key? zaurus-begin-conv-key?)
  207. (define generic-next-candidate-key? zaurus-next-candidate-key?)
  208. (define generic-commit-key? zaurus-commit-key?)
  209. (define generic-cancel-key? zaurus-cancel-key?)
  210. ;; you can use the barbarous bindings with careful key operation
  211. ;(define generic-commit-key? zaurus-barbarous-commit-key?)
  212. ;(define generic-cancel-key? zaurus-barbarous-cancel-key?)
  213.